<template>
    <!-- <mt-popup
      v-model="popupVisible"
      popup-transition="popup-fade">
        <div class="pop-dialog-cat">
          <h1>{{title}}</h1>
          <mt-field placeholder="请输入分类名称" v-model="catname"></mt-field>
          <div class="g-btn">
            <span @click="cannal">取消</span>
            <span @click="comit" class="del">确认</span>
          </div>
        </div>
    </mt-popup> -->
    <div class="pop-cat" v-show="popupVisible">
      <div class="pop-dialog-cat">
          <h1>{{title}}</h1>
          <mt-field placeholder="请输入分类名称" v-model="catname"></mt-field>
          <div class="g-btn">
            <span @click="cannal">取消</span>
            <span @click="comit" class="del">确认</span>
          </div>
        </div>
    </div>
</template>

<script>
import axios from 'axios'
import { Toast } from 'mint-ui'
export default {
  props: {
    popupVisible: {
      type : Boolean
    },
    catid:{
      type:String,
      default:''
    },
    title:{
      type:String
    }
  },
  data() {
    return {
       errorImg01: 'this.src="' + require('../.././assets/logo.png') + '"',
       catname:''
    }
  },
  methods:{
    cannal(){
      //this.popupVisible = false
      this.$emit('cannal');
    },
    comit(){
      //this.popupVisible = false
      this.$emit('comit',this.catname);
    },
    getcatinfo(id){
      let token = localStorage.getItem("access_token");
      let params = {"access_token": token,"catid" : id}
      axios.post(HOST + "/Shop/get_category_info",params).then((res) => {
        res = res.data
        let result = res.result
        if(result == 'success'){
          this.catname = res.data.info.cnname
        }else{
            Toast({
              message:res.message,
              position:'bottom',
              duration:'2000'
            })
          }
      })
    }
  },
  mounted(){
    
  }

}
</script>

<style lang="stylus">
.pop-cat
  background: rgba(0,0,0,0.5)
  position: fixed
  top: 0
  left: 0
  width: 100%
  height: 100%
  z-index: 1000
  .mint-popup
    border-radius 5px
  .pop-dialog-cat
    width:250px
    height:151px
    background: #fff
    z-index: 1001
    border-radius: 5px
    margin: 200px auto
    .mint-cell-wrapper
      border: 1px solid #e5e5e5;
      padding: 0 10px;
      margin: 0 20px;
      border-radius: 5px;
      height: 35px;
      min-height: 35px;
      font-size: 14px;
    h1
      line-height: 50px
      font-size: 16px
      text-align: center
      color: rgb(51,51,51)
      font-weight: 700
      letter-spacing: 1px
    p
      line-height: 30px;
      font-size: 14px;
      color: rgb(51,51,51);
      text-align: center;
      letter-spacing: 1px;
    .g-btn
      clear:both
      margin-top:10px
      display:flex
      span 
        text-align: center
        flex: 1;
        padding: 11px 0
        border-top: 1px solid #e5e5e5
        color:#686868
        &.del
          border-left 1px solid #e5e5e5
          color:#108ee9

</style>